package com.microinvest.controller.stock;
import com.alibaba.fastjson.JSON;
import com.microinvest.entity.Users;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class test {

    @Autowired
    RabbitTemplate rabbitTemplate;

    @PostMapping("/123")
    void testSend(){
        String queueName="q_test_01";
        String msg="hello";
        Users users=new Users("1233","21231213","2139129312@adamdm");
        rabbitTemplate.convertAndSend(queueName, JSON.toJSONString(users));
    }
}
